package com.shanshan.crowd.config;

import com.shanshan.crowd.util.SMSUtil;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @Description
 * @ClassName CrowdMyBeanConfig
 * @Author 山山大魔王
 * @Date 2022/7/29 15:54
 * @Version 1.0
 */
@Configuration
public class CrowdMyBeanConfig {

    @Value("${short.message.serverIp}")
    private String serverIp;
    @Value("${short.message.serverPort}")
    private String serverPort;
    @Value("${short.message.accountSId}")
    private String accountSId;
    @Value("${short.message.accountToken}")
    private String accountToken;
    @Value("${short.message.appId}")
    private String appId;
    @Value("${short.message.templateId}")
    private String templateId;

    @Bean
    public SMSUtil smsUtil(){
        return new SMSUtil(serverIp,serverPort,accountSId ,accountToken ,appId ,templateId);
    }
}
